In the rapidly evolving landscape of financial markets, cryptocurrencies, particularly Bitcoin, have emerged as both a revolutionary asset class and a litmus test for new economic theories. Amidst volatile price movements and burgeoning market participation, understanding the forces that drive trading volume in the cryptocurrency sphere is more critical than ever. This paper delves into the intricate relationship between market indicators and the trading volume of Bitcoin, aiming to unveil patterns that may predict future market behaviors. We will be analyzing the impact of various financial indicators and their effects on Bitcoin trading. Market indicators play a crucial role in understanding the dynamics of Bitcoin trading volumes, reflecting investor sentiment and market trends. Whether it’s traditional metrics like stock market indices or emerging indicators unique to the cryptocurrency space, the impact on Bitcoin trading volume unveils insights into market behavior and influences investment decisions.
• Eray Gemici and Müslüm Polat’s 2019 study in The Journal of Risk Finance examines the relationship between Bitcoin’s price and trading volume, using data from January 1, 2012, to April 7, 2018, sourced from Bitstamp. Analyzing 2286 observations with cointegration and causality tests, they uncover significant causality from price to volume, where price drops decrease volume and volume increases boost prices. Their research innovatively explores both symmetric and asymmetric causality between these variables, highlighting the impact of price changes on trading volumes in the volatile Bitcoin market. By confirming a cointegrated relationship, they contribute to understanding the long-term equilibrium between price and volume in cryptocurrency markets, offering valuable insights for investors and encouraging further academic exploration into digital currency economics.
• Szetela, Mentel, Bilan, and Mentel’s 2021 study in the Eurasian Economic Review investigates the link between Bitcoin’s price trends and trading volume from January 14, 2015, to December 22, 2019. Employing the Vector Error Correction Model (VECM) and the Average Directional Movement Index (ADX) for trend strength, they find no significant long-term connection between trend strength and volume in most market conditions, except for a pronounced relationship during downward trends. Here, volume changes can influence trend strength with a relatively high adjustment speed of 88%. Short-term analysis shows little to no dependency, highlighting a general insensitivity of trend strength to volume changes. This research offers insights into cryptocurrency market dynamics, aiding investors and traders in understanding Bitcoin’s trend-based market behavior.
The dataset uploaded revolve around Bitcoin (BTC) and appears to encompass a range of financial data points from January 2, 2015, to March 9, 2024. It includes 3,355 entries and 20 coulmns. This dataset provides a comprehensive view of Bitcoin’s trading activity and volatility over the specified period. It includes both basic financial metrics (open, high, low, close, volume) and technical indicators (RSI, CCI, SMA, EMA, MACD, Bollinger Bands, True Range, ATR), which are useful for analyzing market trends and making investment decisions.
The dataset we have used offers a solid foundation for analyzing Bitcoin’s price movements and market trends over a specified period. However, like all datasets, it has its own limitations, and there are areas where additional information could enhance its utility. For example, the dataset could incorporate additional financial features that provides more nuanced that aids the understanding of market behavior. For instance, features like volatility indices, the Sharpe ratio, or liquidity measures could offer deeper insights into market risk and investment potential. There are also features like market sentiment. Incorporating data on market sentiment, such as news sentiment analysis, social media trends, and major announcements related to cryptocurrency, could offer predictive insights into price movements. Sentiment analysis can be particularly valuable in markets known for their volatility and sensitivity to news and social media. All these features mentioned could improve and give more depth and dimension to the analysis.
Objective: Get a general understanding of the dataset.
btc_data <- read.csv("btc_2015_2024.csv")
str(btc_data)
## 'data.frame': 3355 obs. of 20 variables:
## $ date : chr "2015-01-02" "2015-01-03" "2015-01-04" "2015-01-05" ...
## $ open : num 314 315 281 265 275 ...
## $ high : num 316 315 287 278 288 ...
## $ low : num 314 281 258 265 273 ...
## $ close : num 315 281 264 274 286 ...
## $ volume : num 7860650 33054400 55629100 43962800 23245700 ...
## $ rsi_7 : num 100 1.94 1.24 21.46 38.27 ...
## $ rsi_14 : num 100 2.1 1.38 19.52 34.35 ...
## $ cci_7 : num -66.7 -100 -110.7 -76.5 -37.1 ...
## $ cci_14 : num -66.7 -100 -110.7 -76.5 -37.1 ...
## $ sma_50 : num 315 303 294 290 289 ...
## $ ema_50 : num 315 303 293 289 288 ...
## $ sma_100 : num 315 303 294 290 289 ...
## $ ema_100 : num 315 303 293 289 289 ...
## $ macd : num 0.0176 -1.0304 -2.0915 -2.215 -1.7467 ...
## $ bollinger : num 315 303 294 290 289 ...
## $ TrueRange : num 2.27 34.07 29.62 14.15 14.86 ...
## $ atr_7 : num 4.19 15.72 20.03 18.47 17.61 ...
## $ atr_14 : num 4.28 14.95 19.03 17.91 17.3 ...
## $ next_day_close: num 281 264 274 286 294 ...
Objective: Get a general understanding of the dataset.
library(outliers)
btc_data$rsi_7 <- outlierKD2(btc_data, btc_data$rsi_7, TRUE)
## Outliers identified: 0
## Proportion (%) of outliers: 0
## Mean of the outliers: NaN
## Mean without removing outliers: 54.1
## Mean if we remove outliers: 54.1
## Outliers successfully removed
btc_data$macd <- outlierKD2(btc_data, btc_data$macd, TRUE)
## Outliers identified: 755
## Proportion (%) of outliers: 29
## Mean of the outliers: 380
## Mean without removing outliers: 114
## Mean if we remove outliers: 36.5
## Outliers successfully removed
btc_data <- na.omit(btc_data)
btc_data$date <- as.Date(btc_data$date)
str(btc_data)
## 'data.frame': 3355 obs. of 20 variables:
## $ date : Date, format: "2015-01-02" "2015-01-03" ...
## $ open : num 314 315 281 265 275 ...
## $ high : num 316 315 287 278 288 ...
## $ low : num 314 281 258 265 273 ...
## $ close : num 315 281 264 274 286 ...
## $ volume : num 7860650 33054400 55629100 43962800 23245700 ...
## $ rsi_7 :'data.frame': 3355 obs. of 22 variables:
## ..$ date : chr "2015-01-02" "2015-01-03" "2015-01-04" "2015-01-05" ...
## ..$ open : num 314 315 281 265 275 ...
## ..$ high : num 316 315 287 278 288 ...
## ..$ low : num 314 281 258 265 273 ...
## ..$ close : num 315 281 264 274 286 ...
## ..$ volume : num 7860650 33054400 55629100 43962800 23245700 ...
## ..$ rsi_7 : num 100 1.94 1.24 21.46 38.27 ...
## ..$ rsi_14 : num 100 2.1 1.38 19.52 34.35 ...
## ..$ cci_7 : num -66.7 -100 -110.7 -76.5 -37.1 ...
## ..$ cci_14 : num -66.7 -100 -110.7 -76.5 -37.1 ...
## ..$ sma_50 : num 315 303 294 290 289 ...
## ..$ ema_50 : num 315 303 293 289 288 ...
## ..$ sma_100 : num 315 303 294 290 289 ...
## ..$ ema_100 : num 315 303 293 289 289 ...
## ..$ macd : num 0.0176 -1.0304 -2.0915 -2.215 -1.7467 ...
## ..$ bollinger : num 315 303 294 290 289 ...
## ..$ TrueRange : num 2.27 34.07 29.62 14.15 14.86 ...
## ..$ atr_7 : num 4.19 15.72 20.03 18.47 17.61 ...
## ..$ atr_14 : num 4.28 14.95 19.03 17.91 17.3 ...
## ..$ next_day_close: num 281 264 274 286 294 ...
## ..$ $ : num 100 1.94 1.24 21.46 38.27 ...
## ..$ btc_data : num 100 1.94 1.24 21.46 38.27 ...
## $ rsi_14 : num 100 2.1 1.38 19.52 34.35 ...
## $ cci_7 : num -66.7 -100 -110.7 -76.5 -37.1 ...
## $ cci_14 : num -66.7 -100 -110.7 -76.5 -37.1 ...
## $ sma_50 : num 315 303 294 290 289 ...
## $ ema_50 : num 315 303 293 289 288 ...
## $ sma_100 : num 315 303 294 290 289 ...
## $ ema_100 : num 315 303 293 289 289 ...
## $ macd :'data.frame': 3355 obs. of 22 variables:
## ..$ date : chr "2015-01-02" "2015-01-03" "2015-01-04" "2015-01-05" ...
## ..$ open : num 314 315 281 265 275 ...
## ..$ high : num 316 315 287 278 288 ...
## ..$ low : num 314 281 258 265 273 ...
## ..$ close : num 315 281 264 274 286 ...
## ..$ volume : num 7860650 33054400 55629100 43962800 23245700 ...
## ..$ rsi_7 :'data.frame': 3355 obs. of 22 variables:
## .. ..$ date : chr "2015-01-02" "2015-01-03" "2015-01-04" "2015-01-05" ...
## .. ..$ open : num 314 315 281 265 275 ...
## .. ..$ high : num 316 315 287 278 288 ...
## .. ..$ low : num 314 281 258 265 273 ...
## .. ..$ close : num 315 281 264 274 286 ...
## .. ..$ volume : num 7860650 33054400 55629100 43962800 23245700 ...
## .. ..$ rsi_7 : num 100 1.94 1.24 21.46 38.27 ...
## .. ..$ rsi_14 : num 100 2.1 1.38 19.52 34.35 ...
## .. ..$ cci_7 : num -66.7 -100 -110.7 -76.5 -37.1 ...
## .. ..$ cci_14 : num -66.7 -100 -110.7 -76.5 -37.1 ...
## .. ..$ sma_50 : num 315 303 294 290 289 ...
## .. ..$ ema_50 : num 315 303 293 289 288 ...
## .. ..$ sma_100 : num 315 303 294 290 289 ...
## .. ..$ ema_100 : num 315 303 293 289 289 ...
## .. ..$ macd : num 0.0176 -1.0304 -2.0915 -2.215 -1.7467 ...
## .. ..$ bollinger : num 315 303 294 290 289 ...
## .. ..$ TrueRange : num 2.27 34.07 29.62 14.15 14.86 ...
## .. ..$ atr_7 : num 4.19 15.72 20.03 18.47 17.61 ...
## .. ..$ atr_14 : num 4.28 14.95 19.03 17.91 17.3 ...
## .. ..$ next_day_close: num 281 264 274 286 294 ...
## .. ..$ $ : num 100 1.94 1.24 21.46 38.27 ...
## .. ..$ btc_data : num 100 1.94 1.24 21.46 38.27 ...
## ..$ rsi_14 : num 100 2.1 1.38 19.52 34.35 ...
## ..$ cci_7 : num -66.7 -100 -110.7 -76.5 -37.1 ...
## ..$ cci_14 : num -66.7 -100 -110.7 -76.5 -37.1 ...
## ..$ sma_50 : num 315 303 294 290 289 ...
## ..$ ema_50 : num 315 303 293 289 288 ...
## ..$ sma_100 : num 315 303 294 290 289 ...
## ..$ ema_100 : num 315 303 293 289 289 ...
## ..$ macd : num 0.0176 -1.0304 -2.0915 -2.215 -1.7467 ...
## ..$ bollinger : num 315 303 294 290 289 ...
## ..$ TrueRange : num 2.27 34.07 29.62 14.15 14.86 ...
## ..$ atr_7 : num 4.19 15.72 20.03 18.47 17.61 ...
## ..$ atr_14 : num 4.28 14.95 19.03 17.91 17.3 ...
## ..$ next_day_close: num 281 264 274 286 294 ...
## ..$ $ : num 0.0176 -1.0304 -2.0915 -2.215 -1.7467 ...
## ..$ btc_data : num 0.0176 -1.0304 -2.0915 -2.215 -1.7467 ...
## $ bollinger : num 315 303 294 290 289 ...
## $ TrueRange : num 2.27 34.07 29.62 14.15 14.86 ...
## $ atr_7 : num 4.19 15.72 20.03 18.47 17.61 ...
## $ atr_14 : num 4.28 14.95 19.03 17.91 17.3 ...
## $ next_day_close: num 281 264 274 286 294 ...
summary(btc_data$rsi_7)
## date open high low
## Length:3355 Min. : 177 Min. : 212 Min. : 172
## Class :character 1st Qu.: 1251 1st Qu.: 1267 1st Qu.: 1226
## Mode :character Median : 8825 Median : 9033 Median : 8657
## Mean :15721 Mean :16089 Mean :15333
## 3rd Qu.:26621 3rd Qu.:27051 3rd Qu.:26319
## Max. :68341 Max. :70083 Max. :68053
## close volume rsi_7 rsi_14
## Min. : 178 Min. :7.86e+06 Min. : 1.2 Min. : 1.4
## 1st Qu.: 1251 1st Qu.:4.42e+08 1st Qu.: 40.2 1st Qu.: 43.6
## Median : 8831 Median :1.33e+10 Median : 52.7 Median : 52.7
## Mean :15740 Mean :1.74e+10 Mean : 54.1 Mean : 53.7
## 3rd Qu.:26692 3rd Qu.:2.77e+10 3rd Qu.: 67.6 3rd Qu.: 62.9
## Max. :68499 Max. :3.51e+11 Max. :100.0 Max. :100.0
## cci_7 cci_14 sma_50 ema_50
## Min. :-233.3 Min. :-438 Min. : 232 Min. : 233
## 1st Qu.: -69.4 1st Qu.: -66 1st Qu.: 1143 1st Qu.: 1130
## Median : 22.2 Median : 25 Median : 8599 Median : 8807
## Mean : 13.0 Mean : 19 Mean :15336 Mean :15350
## 3rd Qu.: 95.4 3rd Qu.: 105 3rd Qu.:26644 3rd Qu.:27003
## Max. : 233.3 Max. : 396 Max. :60802 Max. :59150
## sma_100 ema_100 macd bollinger
## Min. : 238 Min. : 237 Min. :-5053 Min. : 226
## 1st Qu.: 1066 1st Qu.: 1066 1st Qu.: -114 1st Qu.: 1199
## Median : 8395 Median : 8755 Median : 7 Median : 8904
## Mean :15005 Mean :15036 Mean : 114 Mean :15562
## 3rd Qu.:26274 3rd Qu.:26387 3rd Qu.: 296 3rd Qu.:26690
## Max. :55005 Max. :54975 Max. : 5274 Max. :63149
## TrueRange atr_7 atr_14 next_day_close $
## Min. : 1 Min. : 3 Min. : 4 Min. : 178 Min. : 1.2
## 1st Qu.: 52 1st Qu.: 62 1st Qu.: 57 1st Qu.: 1253 1st Qu.: 40.2
## Median : 316 Median : 355 Median : 350 Median : 8835 Median : 52.7
## Mean : 757 Mean : 751 Mean : 746 Mean :15761 Mean : 54.1
## 3rd Qu.: 962 3rd Qu.:1026 3rd Qu.: 996 3rd Qu.:26737 3rd Qu.: 67.6
## Max. :12865 Max. :6055 Max. :5003 Max. :69020 Max. :100.0
## btc_data
## Min. : 1.2
## 1st Qu.: 40.2
## Median : 52.7
## Mean : 54.1
## 3rd Qu.: 67.6
## Max. :100.0
Objective: Understand the data’s basic characteristics. The selection of trading volume, RSI (Relative Strength Index), MACD (Moving Average Convergence Divergence), and Bollinger Bands for visualization in the Bitcoin dataset is based on their significance and common use in financial data analysis, especially in the context of cryptocurrencies like Bitcoin. Here’s why each was chosen:
It indicates how many units of a currency were traded within a specified time frame. In financial markets, higher volume often correlates with price movement, making it a key metric to understand market activity.
library(ggplot2)
### Histogram for RSI
# Flatten the nested 'rsi_7' dataframe column
btc_data$rsi_7 <- btc_data$rsi_7$rsi_7
# Similarly for 'macd' if it's also a nested dataframe
btc_data$macd <- btc_data$macd$macd
# Histogram for Trading Volume
ggplot(btc_data, aes(x = volume)) +
geom_histogram(bins = 30, fill = "blue", color = "black") +
ggtitle("Histogram of Trading Volume") +
xlab("Trading Volume") +
ylab("Frequency")
# Boxplot for Trading Volume
ggplot(btc_data, aes(y = volume)) +
geom_boxplot(fill = "blue") +
ggtitle("Boxplot of Trading Volume") +
ylab("Trading Volume")
# QQ-Plot for Trading Volume
qqnorm(btc_data$volume, main="")
qqline(btc_data$volume, col = "blue")
title("QQ-Plot of Trading Volume")
A momentum oscillator that measures the speed and change of price movements. RSI is often used to identify overbought or oversold conditions in a market, making it crucial for analyzing market sentiment.
# Histogram for RSI
ggplot(btc_data, aes(x = rsi_7)) +
geom_histogram(bins = 30, fill = "green", color = "black") +
ggtitle("Histogram of RSI") +
xlab("RSI") +
ylab("Frequency")
# Boxplot for RSI
ggplot(btc_data, aes(y = rsi_7)) +
geom_boxplot(fill = "green") +
ggtitle("Boxplot of RSI") +
ylab("RSI")
# QQ-Plot for RSI
qqnorm(btc_data$rsi_7, main = "")
qqline(btc_data$rsi_7, col = "green")
title("QQ-Plot of RSI")
A trend-following momentum indicator that shows the relationship between two moving averages of a security’s price. It’s useful for identifying potential buy and sell signals.
# Histogram for MACD
ggplot(btc_data, aes(x = macd)) +
geom_histogram(bins = 30, fill = "red", color = "black") +
ggtitle("Histogram of MACD") +
xlab("MACD") +
ylab("Frequency")
# Boxplot for MACD
ggplot(btc_data, aes(y = macd)) +
geom_boxplot(fill = "red") +
ggtitle("Boxplot of MACD") +
ylab("MACD")
# QQ-Plot for MACD
qqnorm(btc_data$macd, main = "")
qqline(btc_data$macd, col = "red")
title("QQ-Plot of MACD")
A volatility indicator that consists of a middle SMA along with upper and lower bands. It’s particularly helpful in assessing how ‘overbought’ or ‘oversold’ an asset is.
# Histogram for Bollinger Bands
ggplot(btc_data, aes(x = bollinger)) +
geom_histogram(bins = 30, fill = "orange", color = "black") +
ggtitle("Histogram of Bollinger Bands") +
xlab("Bollinger Bands") +
ylab("Frequency")
# Boxplot for Bollinger Bands
ggplot(btc_data, aes(y = bollinger)) +
geom_boxplot(fill = "orange") +
ggtitle("Boxplot of Bollinger Bands") +
ylab("Bollinger Bands")
# QQ-Plot for Bollinger Bands
qqnorm(btc_data$bollinger, main = "")
qqline(btc_data$bollinger, col = "orange")
title("QQ-Plot of Bollinger Bands")
Regarding the types of plots:
Histograms are useful for understanding the distribution of these variables. They can reveal patterns like normal distribution, skewness, or the presence of outliers.
Boxplots provide a visual summary of the key quartiles of a dataset, along with its outliers. They are particularly useful for comparing the distribution and central tendency of a variable across different categories.
QQ-Plots (Quantile-Quantile Plots) are used to assess whether a dataset follows a given distribution, such as the normal distribution. They are beneficial for checking the assumption of normality, which is a prerequisite for many statistical tests.
RSI and CCI
We sorted trading volumes into buckets to make our data easier to understand. This step lets us see the bigger picture, like whether generally, when there’s a lot or a little trading, the RSI and CCI readings signal that Bitcoin’s price might rise or fall.
After organizing the data, it’s clear that both high RSI and CCI values tend to show up when there’s either a lot or very little trading—this might mean the market is optimistic. On the other hand, when trading is somewhere in the middle, the RSI isn’t as strong, suggesting less optimism.
# Load necessary library
library(ggplot2)
# Define volume ranges for analysis
volume_breaks <- quantile(btc_data$volume, probs = seq(0, 1, 0.25))
btc_data$volume_range <- cut(btc_data$volume, breaks = volume_breaks, include.lowest = TRUE, labels = c("Low", "Medium", "High", "Very High"))
# Aggregate data based on volume range
volume_analysis <- aggregate(cbind(rsi_7, cci_7) ~ volume_range, data = btc_data, function(x) c(mean = mean(x, na.rm = TRUE), min = min(x, na.rm = TRUE), max = max(x, na.rm = TRUE)))
# Output the aggregated data
print(volume_analysis)
## volume_range rsi_7.mean rsi_7.min rsi_7.max cci_7.mean cci_7.min cci_7.max
## 1 Low 56.49 1.24 100.00 23.12 -233.33 233.33
## 2 Medium 51.81 5.36 99.01 6.41 -233.33 233.33
## 3 High 52.78 6.82 98.31 1.85 -233.33 233.33
## 4 Very High 55.14 5.97 97.98 20.52 -229.79 233.33
Even though the RSI and CCI can hit highs and lows at any trading volume, it’s clear they’re just part of the story. They don’t always march in step with how much Bitcoin is being traded. This hints that many different things are stirring the pot in the Bitcoin market, and it’s worth looking beyond just these two signals when predicting where things might head.
In this project we looked for most relevant questions that could be answered using the dataset. AS a result we came-up with these questions:
How does Bitcoin’s trading volume respond to changes in its price (open, high, low, close)?
What is the relationship between trading volume and technical indicators such as RSI, MACD, and Bollinger Bands?
In which year’s most of the volume were traded and at what price?
Can we identify patterns or trends in trading volume related to specific market conditions indicated by technical analysis?
The questions emerged from a keen understanding of the cryptocurrency market, its volatility, and the need to explore the impact of various financial indicators on trading behaviors.
CONCEPTUAL FRAMEWORK
Market Trends and Analysis: Recognizing the volatility and the emerging nature of cryptocurrency, especially Bitcoin, we focused on uncovering patterns and trends that could explain market movements. This led to questions targeting the relationship between trading volume and price changes, as well as technical indicators.
Relevance of Financial Indicators: The decision to include RSI, MACD, and Bollinger Bands was informed by their prevalent use and significance in financial market analysis. These indicators are often considered critical tools for traders and analysts in understanding market sentiment and predicting future trends.
Data-Driven Inquiry: The availability of comprehensive Bitcoin trading data from 2015 to 2024 provided a rich resource for empirical analysis. This data availability influenced our questions, allowing us to delve deeply into the statistical relationships between trading volume and various market indicators.
The SMART questions were thus a product of a meticulous process that combined an understanding of the cryptocurrency market, the potential of the available data, and the necessity to provide meaningful, actionable insights into Bitcoin trading. This careful crafting ensured that each question was not only specific and measurable but also achievable, relevant, and time-bound, fitting perfectly into the framework of our analytical goals
Cointegration and Causality Tests
Correlation Analysis
ANOVA (Analysis of Variance)
# Load necessary libraries
library(readr)
library(dplyr)
library(tidyr)
library(ggplot2)
btc_data= data.frame(read.csv("btc_2015_2024.csv"))
# Calculate correlation between trading volume and price metrics
cor_volume_price <- cor(btc_data$volume, btc_data[,c('open', 'high', 'low', 'close')])
# Print the correlation matrix
print(cor_volume_price)
## open high low close
## [1,] 0.667 0.673 0.657 0.666
T-Test Let’s do a t-test to compare trading volumes on days with maximum and minimum prices:
# Categorize the data into 'high' and 'low' price days based on median
high_price_days <- btc_data$close > median(btc_data$close)
low_price_days <- btc_data$close <= median(btc_data$close)
t_test_prices <- t.test(btc_data$volume[high_price_days],
btc_data$volume[low_price_days])
print(t_test_prices)
##
## Welch Two Sample t-test
##
## data: btc_data$volume[high_price_days] and btc_data$volume[low_price_days]
## t = 47, df = 2538, p-value <2e-16
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
## 2.31e+10 2.51e+10
## sample estimates:
## mean of x mean of y
## 2.94e+10 5.31e+09
We found that t-test is not the most appropriate tool for comparing a single day against all others. A different approach might be necessary, such as looking at a range of high and low prices or using other statistical methods to assess the impact of price on volume.
Correlation Test
btc_data$date <- as.Date(btc_data$date, format = "%Y-%m-%d")
# Calculate correlation coefficient
correlation <- cor.test(btc_data$close, btc_data$volume, method = "pearson")
# Print the correlation result
print(correlation)
##
## Pearson's product-moment correlation
##
## data: btc_data$close and btc_data$volume
## t = 52, df = 3353, p-value <2e-16
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
## 0.646 0.684
## sample estimates:
## cor
## 0.666
# Plot
ggplot(btc_data, aes(x = close, y = volume)) +
geom_point(alpha = 0.5) + # Scatter plot points
geom_smooth(method = "lm", color = "blue") + # Regression line
labs(title = "Correlation between BTC Close Price and Trading Volume",
x = "BTC Close Price (USD)",
y = "BTC Trading Volume") +
theme_minimal()
The output indicates a strong positive correlation (r = 0.666) between Bitcoin’s closing price and trading volume, which is statistically significant (p-value < 2e-16). The 95% confidence interval for the correlation coefficient ranges from 0.646 to 0.684, suggesting a moderately strong linear relationship. This implies that as the Bitcoin closing price increases, the trading volume tends to increase as well, with a fairly high degree of confidence in this observed relationship across the dataset.
# Select the columns relevant for the analysis
btc_analysis <- btc_data %>%
select(volume, rsi_7, rsi_14, macd, bollinger)
# Calculate correlation matrix for the selected columns
cor_volume_indicators <- cor(btc_analysis)
# Print the correlation matrix focusing on volume
print(cor_volume_indicators['volume',])
## volume rsi_7 rsi_14 macd bollinger
## 1.00000 -0.00248 0.01824 0.20005 0.66272
# Install necessary packages
# install.packages("GGally")
# install.packages("TTR")
# install.packages("quantmod")
# install.packages("lmtest")
# install.packages("dplyr")
# install.packages("ggplot2")
library(readr) # For reading CSV files
library(dplyr) # For data manipulation
library(ggplot2) # For data visualization
library(GGally) # For advanced correlation plots
library(TTR) # For technical indicators like RSI, MACD
library(quantmod) # For additional financial analysis tools
# Correlation plot for selected variables
ggcorr(btc_data[,c('volume', 'open', 'high', 'low', 'close', 'rsi_7', 'rsi_14', 'macd', 'bollinger')],
label = TRUE)
btc_data$date <- as.Date(btc_data$date)
ggplot(btc_data, aes(x = date)) +
geom_line(aes(y = close, color = "Close Price")) +
geom_line(aes(y = volume/1000000, color = "Volume (Millions)")) +
labs(title = "Bitcoin Close Price and Volume Over Time", x = "Date", y = "") +
scale_color_manual("", values = c("Close Price" = "blue", "Volume (Millions)" = "red")) +
theme_minimal()
We conduct a correlation analysis and visualize it:
# Correlation analysis
cor_volume_rsi <- cor.test(btc_data$volume, btc_data$rsi_7)
cor_volume_macd <- cor.test(btc_data$volume, btc_data$macd)
cor_volume_bbands <- cor.test(btc_data$volume, btc_data$bollinger)
# Output the results
print(cor_volume_rsi)
##
## Pearson's product-moment correlation
##
## data: btc_data$volume and btc_data$rsi_7
## t = -0.1, df = 3353, p-value = 0.9
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
## -0.0363 0.0314
## sample estimates:
## cor
## -0.00248
print(cor_volume_macd)
##
## Pearson's product-moment correlation
##
## data: btc_data$volume and btc_data$macd
## t = 12, df = 3353, p-value <2e-16
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
## 0.167 0.232
## sample estimates:
## cor
## 0.2
print(cor_volume_bbands)
##
## Pearson's product-moment correlation
##
## data: btc_data$volume and btc_data$bollinger
## t = 51, df = 3353, p-value <2e-16
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
## 0.643 0.681
## sample estimates:
## cor
## 0.663
library(ggplot2)
# Scatterplot for Volume vs. RSI
ggplot(btc_data, aes(x = rsi_7, y = volume)) +
geom_point(alpha = 0.5) +
geom_smooth(method = "lm", col = "blue") +
ggtitle("Scatterplot of Trading Volume vs. RSI") +
xlab("RSI") +
ylab("Trading Volume")
# Histogram for Trading Volume
ggplot(btc_data, aes(x = volume)) +
geom_histogram(binwidth = 5000000, fill = 'blue', color = 'black') +
ggtitle("Histogram of Bitcoin Trading Volume") +
xlab("Trading Volume") + ylab("Frequency")
# Boxplot for Trading Volume vs. Bollinger Bands
ggplot(btc_data, aes(x = as.factor(bollinger > median(btc_data$bollinger)), y = volume)) +
geom_boxplot() +
ggtitle("Boxplot of Trading Volume vs. Bollinger Bands") +
xlab("Bollinger Bands Category") +
ylab("Trading Volume")
The correlation analysis and the provided plots indicate different levels of association between Bitcoin trading volume and various technical indicators:
Trading Volume and RSI: The correlation coefficient is approximately -0.00248, with a p-value of 0.9. This suggests no significant linear relationship between trading volume and the RSI. The scatterplot supports this finding, showing no clear pattern or trend between the RSI and trading volume.
Trading Volume and MACD: The correlation coefficient is about 0.156 with a p-value close to 0. This indicates a weak positive linear relationship between trading volume and the MACD. The scatterplot may show a slight positive trend, but given the weakness of the correlation, the MACD’s predictive power for trading volume is likely limited.
Trading Volume and Bollinger Bands: The correlation coefficient here is 0.663 with a p-value < 2e-16, suggesting a moderate positive linear relationship between trading volume and Bollinger Bands. The plot likely reflects this with higher trading volumes corresponding with the activation of the Bollinger Bands (true category).
These results suggest that among the three technical indicators examined, Bollinger Bands have the most substantial relationship with Bitcoin trading volume, followed by MACD with a weaker association, and RSI with essentially no correlation. These findings can help inform predictions about trading volume based on the status of Bollinger Bands, though further analysis would be needed to build a robust predictive model.
The year 2021 recorded the most traded volumes that was around 17,211,845,901,724 units at an avereage closing price of $47,436.93. The closing price is the last traded price of Bitcoin at the end of each trading day. A high average closing price over the course of the year suggests a strong performance for Bitcoin, as it indicates that prices consistently remained relatively high. This could be indicative of strong demand, investor confidence, or other factors driving up the price. According to our analysis, the data indicates that Bollinger Bands, or their associated index values, reached their peak strength in the year 2021. This suggests that Bitcoin encountered considerable fluctuations and volatility in its price throughout that particular year. In our findings, we figured out that the Commodity Channel index which is a momentum based oscillator that determines when a investment vehicle is reaching a condition of being oversold or overbought was recorded highest in the year 2020 and in the year 2021 most units were bought which suggests a positive correlation between trading volume and commodity channel index.
Price Impact on Trading Volume:
Based on the testing above we conclude that:
Open Price: A correlation of 0.667 suggests a strong positive relationship, indicating that higher opening prices are associated with higher trading volumes.
High Price: A correlation of 0.673 shows a strong positive relationship, indicating that days with higher peaks prices tend to have higher trading volumes.
Low Price: A correlation of 0.657 indicates a strong positive relationship, suggesting that days with lower trough prices still correlate with higher trading volumes, though slightly less so than high or open prices.
Close Price: A correlation of 0.666 indicates a strong positive relationship, suggesting that higher closing prices are associated with higher trading volumes.
There was a strong positive correlation between Bitcoin’s closing price and trading volume (r = 0.666, p-value < 2e-16).
Overall, the results suggests that trading volume tends to increase with the price of Bitcoin across different metrics, with slightly stronger correlations for the high and open prices. This means that trading activity is generally higher on days with greater price movements or higher price levels.
Relationship Between Trading Volume and Technical Indicators:
The correlation coefficients between trading volume and market indicators indicate:
RSI: The RSI indicator, which give you an idea of how overbought or oversold a market is shows almost no correlation with trading volume, suggesting that momentum alone, as measured by RSI, is not a significant driver of trading volume in the Bitcoin market.
MACD: As for MACD, the weak positive correlation with MACD suggests that stronger trends may be accompanied by slightly higher trading volumes.
Bollinger bands: The strongest correlation observed is with the Bollinger Bands indicator, it implies that trading volume is more responsive to price volatility and the price’s position relative to historical variability. This can be useful for traders and analysts, suggesting that periods of high volatility might be opportune times for trade execution due to higher liquidity.
Patterns and Trends in Trading Volume: - Finding: The study showed significant yearly trends in Bitcoin trading volume, with certain years exhibiting markedly higher volumes. - Implication: This underscores the impact of broader market conditions and possibly external factors on Bitcoin trading activity over the years. Visual Evidence from the Analysis
To further illustrate these findings, let’s reference a few key plots:
Correlation Plot Between BTC Close Price and Trading Volume:
ggplot(btc_data, aes(x = close, y = volume)) +
geom_point(alpha = 0.5) + # Scatter plot points
geom_smooth(method = "lm", color = "blue") + # Regression line
labs(title = "Correlation between BTC Close Price and Trading Volume",
x = "BTC Close Price (USD)",
y = "BTC Trading Volume") +
theme_minimal()
This plot clearly shows a positive trend line, supporting the conclusion that higher close prices are associated with higher trading volumes.
Scatterplot of Trading Volume vs. Bollinger Bands:
ggplot(btc_data, aes(x = bollinger, y = volume)) +
geom_point(alpha = 0.5) +
geom_smooth(method = "lm", color = "orange") +
labs(title = "Scatterplot of Trading Volume vs. Bollinger Bands", x = "Bollinger Bands", y = "Trading Volume")
This scatterplot demonstrates a visible upward trend, indicating a relationship between higher Bollinger Band values and increased trading volumes.
Yearly Trading Volume Analysis:
# Extract year from date
btc_data$year <- format(btc_data$date, "%Y")
# ANOVA for yearly trends
aov_results <- aov(volume ~ year, data = btc_data)
summary(aov_results)
## Df Sum Sq Mean Sq F value Pr(>F)
## year 9 8.32e+23 9.24e+22 760 <2e-16 ***
## Residuals 3345 4.07e+23 1.22e+20
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
The findings from our study are pivotal for understanding Bitcoin’s market dynamics. They not only illuminate the significance of price changes and certain technical indicators in influencing trading volumes but also reveal the varying impact of these factors over time. This information is invaluable for investors and market analysts, aiding in the development of more nuanced trading strategies and a deeper understanding of market movements.
While our analysis has provided substantial insights, further research could explore the causality between these variables, investigate the impact of external factors like regulatory changes or macroeconomic indicators, and potentially delve into predictive modeling for future market behavior.
In conclusion, our study contributes significantly to the understanding of Bitcoin trading since there are connections between market indicators and trading volume offering empirical evidence and analytical perspectives that enhance our comprehension of this complex and ever-evolving market.
Gemici, E., & Polat, M. (2019). Relationship between price and volume in the Bitcoin market. The Journal of Risk Finance, 20(5), 411-422. https://doi.org/10.1108/JRF-07-2018-0111
Szetela, B., Mentel, G., Bilan, Y., & Mentel, U. (2021). The relationship between trend and volume on the bitcoin market. Eurasian Economic Review, February 2021. https://doi.org/10.1007/s40822-021-00166-5